package com.bolt.admin.module.controller;

import com.bolt.admin.module.sys.service.VerifyService;
import com.bolt.common.BoltConstants;
import com.bolt.convention.data.ResultMessage;
import com.bolt.convention.data.Results;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequiredArgsConstructor
@RequestMapping("/api/code")
@Api(tags = "系统：验证码管理")
public class VerifyController {

    private final VerifyService verifyService;



    @PostMapping(value = "/sendEmailCode")
    @ApiOperation("重置邮箱，发送验证码")
    public ResultMessage resetEmail(@RequestParam String email){
        verifyService.sendEmailCode(email, BoltConstants.EMAIL_RESET_EMAIL_CODE_KEY);
        return Results.success();
    }
}

 